<template>
  <div class="user-info">
    <!-- 个人信息 -->
    <el-form label-width="220px">
      <!--手机 -->

      <el-form-item label="手机">
<<<<<<< HEAD
        <el-input v-model="userInfo.mobile" style="width:220px" />
=======
        <el-input v-model="userInfo.mobile" style="width: 220px" />
>>>>>>> a9972fb9b0473e8e8d6ab928bdacb7c4e00fcd7f
      </el-form-item>

      <!-- 工号 入职时间 -->

      <el-form-item label="入职时间">
        <el-date-picker
          v-model="userInfo.timeOfEntry"
          type="date"
          class="inputW"
          value-format="yyyy-MM-dd"
        />
      </el-form-item>

      <!-- 员工照片 -->

      <el-form-item label="员工头像">
        <!-- 放置上传图片 -->
<<<<<<< HEAD
        <!-- <img> -->
        <UploadImg v-model="userInfo.staffPhoto" />
      </el-form-item>
      <el-form-item>
        <p />
      </el-form-item>
=======
        <UploadImg v-model="userInfo.staffPhoto" />
      </el-form-item>

>>>>>>> a9972fb9b0473e8e8d6ab928bdacb7c4e00fcd7f
      <!-- 保存个人信息 -->
      <el-form-item>
        <el-button type="primary" @click="update">保存更新</el-button>
        <el-button @click="$router.back()">返回</el-button>
      </el-form-item>
    </el-form>
  </div>
</template>
<script>
import { getuserimg } from '@/api/user'
<<<<<<< HEAD
import { updateById } from '@/api/employees'
=======
import { updateMenus } from '@/api/employees'
>>>>>>> a9972fb9b0473e8e8d6ab928bdacb7c4e00fcd7f
import UploadImg from '@/components/UploadImg/UploadImg.vue'
export default {
  components: { UploadImg },
  data() {
    return {
      userId: this.$route.query.id,
      userInfo: {
        mobile: '',
        timeOfEntry: ''
<<<<<<< HEAD
      },
      loadimg: ''
    }
  },
  created() {
    this.getinfo()
  },
  methods: {
    async update() {
      const data = await updateById(this.userInfo)
      console.log(data)
    },
    async getinfo() {
      const { data: res } = await getuserimg(this.$route.query.id)
      console.log(res)
      this.userInfo = res
=======
      }
    }
  },
  created() {
    this.getlist()
  },
  methods: {
    async getlist() {
      const { data: res } = await getuserimg(this.$route.query.id)
      console.log(res)
      this.userInfo = res
    },
    async update() {
      const { data: res } = await updateMenus(this.userInfo)
      console.log(res)
>>>>>>> a9972fb9b0473e8e8d6ab928bdacb7c4e00fcd7f
    }
  }
}
</script>

<style scoped lang="scss">
<<<<<<< HEAD
  .user-info{
    padding-top:20px;
  }
=======
.user-info {
  padding-top: 20px;
}
>>>>>>> a9972fb9b0473e8e8d6ab928bdacb7c4e00fcd7f
</style>
